package com.yunchang.springboot.mapper.mwsreport;

import com.yunchang.springboot.models.mwsreportbean.MwsCustomerShipmentSales;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MwsCustomerShipmentSalesMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MwsCustomerShipmentSales record);

    int insertSelective(MwsCustomerShipmentSales record);

    MwsCustomerShipmentSales selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MwsCustomerShipmentSales record);

    int updateByPrimaryKey(MwsCustomerShipmentSales record);

    String getLatestDay(@Param("sellerId") String sellerId, @Param("area") String area);

    /**
     * 根据createTime获取对应的数据
     * @param time
     * @return
     */
    List<MwsCustomerShipmentSales> selectByCreateTime(String time);

    /**
     * 根据是否生成财务数据获取对应的数据
     * @param financeStatus
     * @param limitValue
     * @param date
     * @return
     */
    List<MwsCustomerShipmentSales> selectByFinanceStatus(@Param("financeStatus") Integer financeStatus,@Param("limitValue") Integer limitValue,@Param("date") String date);

    /**
     * 根据mwsCustomerShipmentSalesList集合对finance的状态进行更新
     * @param mwsCustomerShipmentSalesList
     * @return
     */
    int updateFinanceStatusByMwsCustomerShipmentSalesList(@Param("mwsCustomerShipmentSalesList") List<MwsCustomerShipmentSales> mwsCustomerShipmentSalesList);

    /**
     * 根据参数获取currency
     * @param sellerId
     * @param amazonOrderId
     * @return
     */
    String selectCurrencyBySellerIdAndAmazonOrderId(String sellerId,String amazonOrderId);
}